From: Subramanya Sastry Date: Wed, 1 Apr 2015 20:07:44 +0000 (-0500) Subject: Sync up with Parsoid parserTests. X-Git-Tag: 1.31.0-rc.0~11888^2 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=278c83af8b2426d95f578e01e3bc679abf7b9d4b;p=lhc%2Fweb%2Fwiklou.git Sync up with Parsoid parserTests. This now aligns with Parsoid commit ea9c04956577c35ec15609a966bf5a4d5541ab45 Change-Id: I310a0c652eb41a9845cfaa3c90262762b6ee4cc8 --- diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index f660678af7..e96535292b 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -146,6 +146,13 @@ Template:table_attribs_4 | style="background-color:#DC241f;" width="10px" | !! endarticle +!! article +Template:table_attribs_5 +!! text + +|style="color:red;"||Bar +!! endarticle + !! article Template:table_header_cells !! text @@ -4080,6 +4087,7 @@ Definition Lists: colons occurring in tags :b ;{{echo|a:b}} ;{{echo|''a:b''}} +;;;''a:b'' !! html+tidy
a
@@ -4101,6 +4109,17 @@ Definition Lists: colons occurring in tags
b
a:b
+
+
+
+
+
+
a:b
+
+
+
+
+
!! end !! test @@ -5799,6 +5818,7 @@ Indented table markup mixed with indented pre content (proposed in bug 6200) {| |{{table_attribs}} | {{table_attribs}} +|| {{table_attribs_5}} | {{table_attribs}} |align=center {{table_attribs}} | align=center {{table_attribs}} @@ -5810,6 +5830,9 @@ Indented table markup mixed with indented pre content (proposed in bug 6200) Foo + style="color:red;" +Bar + Foo Foo @@ -5929,7 +5952,7 @@ Wikitext table with a lot of comments | foo -|- +|- | @@ -5945,6 +5968,26 @@ Wikitext table with a lot of comments !! end +!! test +Wikitext table comments represented in parsoid dom +!! wikitext +{| +|- +| x +|} +!! html/php+tidy + + + + +
x
+!! html/parsoid + + + +
x
+!! end + !! test Wikitext table with double-line table cell !! wikitext @@ -6396,7 +6439,7 @@ parsoid=html2wt Testing serialization after deletion of table cells !!options parsoid={ - "modes": ["wt2wt"], + "modes": ["wt2wt", "selser"], "changes": [ ["#x", "remove"] ] @@ -7656,6 +7699,7 @@ Blah blah blah ### ### Redirects, Parsoid-only ### + !! test 1. Simple redirect to page !! options @@ -7666,16 +7710,20 @@ parsoid !! end -# Only wt2html and html2html since "Main_Page" will serialize to "Main Page" !! test 2. Other redirect variants -!! options -parsoid=wt2html,wt2wt !! wikitext #REDIRECT [[Main_Page]] +!! html/parsoid + +!! end + +!! test +3. Other redirect variants +!! wikitext #REDIRECT [[[[Bar]]]] !! html/parsoid - + !! end !! test @@ -7732,7 +7780,7 @@ parsoid=wt2html !! test Redirect to category !! options -parsoid=wt2html +parsoid=wt2wt,wt2html !! wikitext #REDIRECT [[Category:Foo]] !! html @@ -7752,11 +7800,11 @@ parsoid=wt2html !! test Redirect to category page !! options -parsoid=wt2html,html2html +parsoid !! wikitext #REDIRECT [[:Category:Foo]] !! html -

Category:Foo

+ !! end !! test @@ -7786,7 +7834,7 @@ parsoid !! wikitext #REDIRECT [[en:File:Wiki.png]] !! html - + !! end !! test @@ -7796,7 +7844,7 @@ parsoid !! wikitext #REDIRECT [[meatball:File:Wiki.png]] !! html - + !! end !! test @@ -7810,6 +7858,18 @@ language=is !! end +!! test +Redirect syntax under text isn't considered a redirect +!! wikitext +some text +#redirect [[Main Page]] +!! html/parsoid +

some text

+
  1. redirect Main Page
+!! end + +# FIXME: Should hoist the redirect to the top of the page and ensure there +# is only one. !! test New redirect !! options @@ -11723,7 +11783,7 @@ parsoid=wt2html,wt2wt,html2html

Foobar.jpg

!! html/parsoid -

+

!! end !! test @@ -11734,7 +11794,7 @@ Simple image (using File: namespace, now canonical)

Foobar.jpg

!! html/parsoid -

+

!! end !! test @@ -11745,7 +11805,7 @@ Right-aligned image
Foobar.jpg
!! html/parsoid -
+
!! end !! test @@ -11756,7 +11816,7 @@ Image with caption
Caption text
!! html/parsoid -
Caption text
+
Caption text
!! end !! test @@ -11767,7 +11827,7 @@ Image with caption, bug 53312 #1
Caption page stuff
!! html/parsoid -
Caption page stuff
+
Caption page stuff
!! end !! test @@ -11778,7 +11838,7 @@ Image with caption, bug 53312 #2
Caption page=
!! html/parsoid -
Caption page=
+
Caption page=
!! end !! test @@ -11789,7 +11849,7 @@ Image with caption, bug 53312 #3
Caption page=stuff
!! html/parsoid -
Caption page=stuff
+
Caption page=stuff
!! end !! test @@ -11805,7 +11865,7 @@ thumbsize=220
Caption Link1 [[]] Link2
!! html/parsoid -
Caption Link1 +
Caption Link1 [[]] Link2
@@ -11837,7 +11897,7 @@ Linktrails should not work for images: [[File:Foobar.jpg]]s

Linktrails should not work for images: Foobar.jpgs

!! html/parsoid -

Linktrails should not work for images: s

+

Linktrails should not work for images: s

!! end !! test @@ -11850,7 +11910,7 @@ parsoid=wt2html,wt2wt,html2html
Caption text
!! html/parsoid -
Caption text
+
Caption text
!! end !! test @@ -11861,7 +11921,7 @@ parsoid=wt2html,wt2wt,html2html
This is a caption
!! html/parsoid -
This is a caption
+
This is a caption
!! end !! test @@ -11872,7 +11932,7 @@ parsoid=wt2html,wt2wt,html2html
This is a caption
!! html/parsoid -
This is a caption
+
This is a caption
!! end !! test @@ -11883,7 +11943,7 @@ parsoid=wt2html,wt2wt,html2html

Foobar.jpg

!! html/parsoid -

+

!! end ## Parsoid does not provide editing support for images where templates produce multiple image attributes. @@ -11896,7 +11956,7 @@ Image with multiple attributes from the same template
Caption text
!! html/parsoid -
Caption text
+
Caption text
!! end !! test @@ -11927,9 +11987,9 @@ thumbsize=220

456

!! html/parsoid -

123456

-

123

456

-

123

456

+

123456

+

123

456

+

123

456

!! end !! test @@ -11940,7 +12000,7 @@ Image with multiple captions -- only last one is accepted
Caption3 - accepted
!! html/parsoid -
Caption3 - accepted
+
Caption3 - accepted
!! end !! test @@ -11951,7 +12011,7 @@ Image with multiple widths -- use last

caption

!! html/parsoid -

+

!! end !! test @@ -11967,8 +12027,8 @@ thumbsize=220

caption

!! html/parsoid -
caption
-

+
caption
+

!! end !! test @@ -11983,9 +12043,9 @@ Image with width attribute at different positions
Caption
!! html/parsoid -
Caption
-
Caption
-
Caption
+
Caption
+
Caption
+
Caption
!! end # a sad bit of backward-compatibility @@ -12001,7 +12061,7 @@ parsoid=wt2html,wt2wt,html2html Foobar.jpg

!! html/parsoid -

+

!! end !! test @@ -12012,7 +12072,7 @@ Image with link parameter, wiki target

Foobar.jpg

!! html/parsoid -

+

!! end # parsoid bug 49293 (part 1) @@ -12024,7 +12084,7 @@ Image with link parameter, URL target

Foobar.jpg

!! html/parsoid -

+

!! end # parsoid bug 49293 (part 2) @@ -12036,7 +12096,7 @@ Image with link parameter, protocol-less URL target

Foobar.jpg

!! html/parsoid -

+

!! end !! test @@ -12091,7 +12151,7 @@ Image with empty link parameter

Foobar.jpg

!! html/parsoid -

+

!! end !! test @@ -12102,7 +12162,7 @@ Image with link parameter (wiki target) and unnamed parameter

Title

!! html/parsoid -

+

!! end !! test @@ -12113,7 +12173,7 @@ Image with link parameter (URL target) and unnamed parameter

Title

!! html/parsoid -

+

!! end !! test @@ -12127,7 +12187,7 @@ parsoid=wt2html,wt2wt,html2html
Title
!! html/parsoid -
Title
+
Title
!! end !! test @@ -12140,7 +12200,7 @@ thumbsize=220
Title
!! html/parsoid -
Title
+
Title
!! end !! test @@ -12154,7 +12214,7 @@ parsoid=wt2html,wt2wt,html2html
Title
!! html/parsoid -
Title
+
Title
!! end !! test @@ -12168,7 +12228,7 @@ parsoid=wt2html,wt2wt,html2html
Title
!! html/parsoid -
Title
+
Title
!! end !! test @@ -12182,7 +12242,7 @@ parsoid=wt2html,wt2wt,html2html
Title
!! html/parsoid -
Title
+
Title
!! end !! test @@ -12196,7 +12256,7 @@ parsoid=wt2html,wt2wt,html2html
alttext
Title
!! html/parsoid -
alttext
Title
+
alttext
Title
!! end !! test @@ -12209,7 +12269,7 @@ parsoid=wt2html,wt2wt,html2html
This is a test image Main Page
!! html/parsoid -
This is a test image Main Page
+
This is a test image Main Page
!! end !! test @@ -12222,7 +12282,7 @@ parsoid=wt2html,wt2wt,html2html
Altitude
This is a test image Main Page
!! html/parsoid -
Altitude
This is a test image Main Page
+
Altitude
This is a test image Main Page
!! end !! test @@ -12238,8 +12298,8 @@ parsoid=wt2html,wt2wt,html2html

testing bold in alt

!! html/parsoid -

-

testing bold in alt

+

+

testing bold in alt

!! end !! test @@ -12250,7 +12310,7 @@ Alt image option should handle most kinds of wikitext without barfing
This is a link and a bold template.
This is the image caption
!! html/parsoid -
This is a link and a bold template.
This is the image caption
+
This is a link and a bold template.
This is the image caption
!! end ################### @@ -12274,9 +12334,9 @@ parsoid=wt2html,wt2wt,html2html

caption

!! html/parsoid -

-

-

+

+

+

!! end !! test @@ -12293,9 +12353,9 @@ parsoid=wt2html,wt2wt,html2html
caption
!! html/parsoid -
caption
-
caption
-
caption
+
caption
+
caption
+
caption
!! end !! test @@ -12312,9 +12372,9 @@ parsoid=wt2html,wt2wt,html2html
caption
!! html/parsoid -
caption
-
caption
-
caption
+
caption
+
caption
+
caption
!! end ################### @@ -12341,8 +12401,8 @@ parsoid=wt2html,wt2wt,html2html

Foobar.jpg

!! html/parsoid -

-

+

+

!! end !! test @@ -12358,8 +12418,8 @@ parsoid=wt2html,wt2wt,html2html

Foobar.jpg

!! html/parsoid -

-

+

+

!! end !! test @@ -12372,7 +12432,7 @@ parsoid=wt2html,wt2wt,html2html
Foobar.jpg
!! html/parsoid -
+
!! end !! test @@ -12388,8 +12448,8 @@ parsoid=wt2html,wt2wt,html2html
Foobar.svg
!! html/parsoid -
-
+
+
!! end !! test @@ -12402,7 +12462,7 @@ parsoid=wt2html,wt2wt,html2html

Foobar.jpg

!! html/parsoid -

+

!! end !! test @@ -12418,8 +12478,8 @@ parsoid=wt2html,wt2wt,html2html

Foobar.svg

!! html/parsoid -

-

+

+

!! end !! test @@ -12441,10 +12501,10 @@ parsoid=wt2html,wt2wt,html2html
Foobar.jpg
!! html/parsoid -
-
-
-
+
+
+
+
!! end ################### @@ -12477,7 +12537,7 @@ Frameless image caption with a free URL

http://example.com

!! html/parsoid -

+

!! end !! test @@ -12490,7 +12550,7 @@ thumbsize=220 !! html/parsoid -
http://example.com
+
http://example.com
!! end !! test @@ -12504,7 +12564,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid -
Alteration
http://example.com
+
Alteration
http://example.com
!! end !! test @@ -12516,7 +12576,7 @@ SVG thumbnails with no language set
caption
!! html/parsoid -
caption
+
caption
!! end !! test @@ -12529,7 +12589,7 @@ parsoid=wt2html,wt2wt,html2html
caption
!! html/parsoid -
caption
+
caption
!! end !! test @@ -12542,7 +12602,7 @@ parsoid=wt2html,wt2wt,html2html
lang=invalid.language.code
!! html/parsoid -
lang=invalid.language.code
+
lang=invalid.language.code
!! end !! test @@ -12553,7 +12613,7 @@ BUG 1887: A ISBN with a thumbnail !! html/parsoid -
ISBN 1235467890
+
ISBN 1235467890
!! end !! test @@ -12564,7 +12624,7 @@ BUG 1887: A RFC with a thumbnail
This is RFC 12354
!! html/parsoid -
This is RFC 12354
+
This is RFC 12354
!! end !! test @@ -12575,7 +12635,7 @@ BUG 1887: A mailto link with a thumbnail !! html/parsoid -
Please mailto:nobody@example.com
+
Please mailto:nobody@example.com
!! end # Pending resolution to bug 368 @@ -12587,7 +12647,7 @@ BUG 648: Frameless image caption with a link

text with a link in it

!! html/parsoid -

+

!! end !! test @@ -12598,7 +12658,7 @@ BUG 648: Frameless image caption with a link (suffix)

text with a linkfoo in it

!! html/parsoid -

+

!! end !! test @@ -12609,7 +12669,7 @@ BUG 648: Frameless image caption with an interwiki link

text with a MeatBall:Link in it

!! html/parsoid -

+

!! end !! test @@ -12620,7 +12680,7 @@ BUG 648: Frameless image caption with a piped interwiki link

text with a link in it

!! html/parsoid -

+

!! end !! test @@ -12631,7 +12691,7 @@ Escape HTML special chars in image alt text

& < > "

!! html/parsoid -

+

!! end !! test @@ -12642,7 +12702,7 @@ BUG 499: Alt text should have Ӓ, not &1234;

♀

!! html/parsoid -

+

!! end !! test @@ -12666,7 +12726,7 @@ Image caption containing another image
This is a caption with another image inside it!
!! html/parsoid -
This is a caption with another inside it!
+
This is a caption with another inside it!
!! end !! test @@ -12678,7 +12738,7 @@ Image: caption containing a newline

This *is some text

!! html/parsoid -

+

!!end !!test @@ -12690,7 +12750,7 @@ Image: caption containing leading space
bar
!! html/parsoid -
bar
+
bar
!!end !! test @@ -12709,7 +12769,7 @@ and some more text.]]
This is an example image thumbnail caption with a table
Foo Bar
Foo1 Bar1
and some more text.
!! html/parsoid -
This is an example image thumbnail caption with a table +
This is an example image thumbnail caption with a table @@ -12726,7 +12786,7 @@ Bug 3090: External links other than http: in image captions
This caption has irc and Secure ext links in it.
!! html/parsoid -
This caption has irc and Secure ext links in it.
+
This caption has irc and Secure ext links in it.
!! end !! test @@ -12739,7 +12799,7 @@ parsoid=wt2html,wt2wt,html2html

a

!! html/parsoid -

+

!! end !! test @@ -12753,7 +12813,7 @@ language=es
caption
!! html/parsoid -
caption
+
caption
!! end !! test @@ -12768,7 +12828,7 @@ language=es
caption
!! html/parsoid -
caption
+
caption
!! end !! test @@ -12782,7 +12842,7 @@ parsoid=wt2html,wt2wt,html2html

caption

!! html/parsoid -

+

!! end # Note that 'right' is the default alignment, despite the misspelled 'righ' below @@ -12803,9 +12863,9 @@ parsoid=wt2html,wt2wt,html2html
caption
!! html/parsoid -
caption
-
caption
-
caption
+
caption
+
caption
+
caption
!! end !! article @@ -12835,7 +12895,7 @@ wgEnableUploads=0

File:Foobaz.jpg

!! html/parsoid -

+

!! end # Parsoid-specific testing for images @@ -12850,7 +12910,7 @@ Parsoid-specific image handling - simple image with size and middle alignment !! wikitext [[File:Foobar.jpg|middle|50px]] !! html/parsoid -

+

!! end !! test @@ -12861,7 +12921,7 @@ parsoid=wt2wt,wt2html,html2html !! wikitext [[Image:Foobar.jpg|middle|50px]] !! html/parsoid -

+

!! end !! test @@ -12870,7 +12930,7 @@ Parsoid-specific image handling - simple image with size and middle alignment !! wikitext [[File:Foobar.jpg|50px|middle]] !! html/parsoid -

+

!! end !! test @@ -12881,7 +12941,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[Image:Foobar.jpg|50px|middle]] !! html/parsoid -

+

!! end !! test @@ -12889,7 +12949,7 @@ Parsoid-specific image handling - simple image with both sizes, a baseline align !! wikitext [[File:Foobar.jpg|500x10px|baseline|caption]] !! html/parsoid -

+

!! end !! test @@ -12897,7 +12957,7 @@ Parsoid-specific image handling - simple image with border and size spec !! wikitext [[File:Foobar.jpg|50px|border|caption]] !! html/parsoid -

+

!! end !! test @@ -12905,7 +12965,7 @@ Parsoid-specific image handling - thumbnail with halign, valign, and caption !! wikitext [[File:Foobar.jpg|left|baseline|thumb|caption content]] !! html/parsoid -
caption content
+
caption content
!! end !! test @@ -12914,7 +12974,7 @@ Parsoid-specific image handling - thumbnail with halign, valign, and caption !! wikitext [[File:Foobar.jpg|thumb|left|baseline|caption content]] !! html/parsoid -
caption content
+
caption content
!! end !! test @@ -12922,7 +12982,7 @@ Parsoid-specific image handling - thumbnail with specific size, halign, valign, !! wikitext [[Image:Foobar.jpg|right|middle|thumb|50x50px|caption]] !! html/parsoid -
caption
+
caption
!! end !! test @@ -12931,7 +12991,7 @@ valign, and caption (existing content) !! wikitext [[File:Foobar.jpg|thumb|50x50px|right|middle|caption]] !! html/parsoid -
caption
+
caption
!! end !! test @@ -12942,7 +13002,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|frame|500x50px|caption]] !! html/parsoid -
caption
+
caption
!! end !! test @@ -12953,7 +13013,7 @@ parsoid=wt2html,wt2wt,html2html !! wikitext [[File:Foobar.jpg|left|baseline|frame|500x50px|caption]] !! html/parsoid -
caption
+
caption
!! end !! test @@ -12961,7 +13021,7 @@ Parsoid-specific image handling - frameless image with specific size, border, an !! wikitext [[File:Foobar.jpg|frameless|442x50px|border|caption]] !! html/parsoid -

+

!! end !! test @@ -12969,7 +13029,7 @@ Parsoid-specific image handling - simple image with a formatted caption !! wikitext [[File:Foobar.jpg|
Foo Bar
ab
c
]] !! html/parsoid -

+

!! end !! test @@ -12977,7 +13037,7 @@ Parsoid-specific image handling - caption with a template in it !! wikitext [[File:Foobar.jpg|thumb|200x23px|This caption has a {{echo|transclusion}} in it.]] !! html/parsoid -
This caption has a transclusion in it.
+
This caption has a transclusion in it.
!! end !! test @@ -12990,7 +13050,7 @@ foo bar !! html/parsoid

foo

-
This caption has a
unbalanced tag in it.
+
This caption has a
unbalanced tag in it.

bar

!! end @@ -13001,7 +13061,7 @@ parsoid=wt2html,wt2wt !! wikitext [[File:Foobar.jpg|thumb|]] !! html/parsoid -
+
!! end # empty captions don't get serialized unless we're in the "round trip" case @@ -13011,9 +13071,10 @@ Parsoid-specific image handling - empty caption (2) parsoid=html2wt !! html/parsoid
- +
@@ -13027,7 +13088,7 @@ Parsoid-specific image handling - whitespace caption !! wikitext [[File:Foobar.jpg|thumb| ]] !! html/parsoid -
+
!! end !! test @@ -13038,7 +13099,7 @@ foo bar !! html/parsoid

foo - + bar

!! end @@ -13410,8 +13471,8 @@ parsoid [[:File:Foo.png|Bar]] !! html

-File:Foo.png -Bar +File:Foo.png +Bar

!! end @@ -13849,7 +13910,7 @@ http://example.com [[File:Foobar.jpg]]

http://example.com Foobar.jpg

!! html/parsoid -

http://example.com

+

http://example.com

!!end !! test @@ -14077,7 +14138,7 @@ http://example.com[[File:Foobar.jpg]]

http://example.comFoobar.jpg

!! html/parsoid -

http://example.com

+

http://example.com

!!end !! test @@ -14472,7 +14533,7 @@ Image link to nonexistent file (bug 1850 - good)

File:No such.jpg

!! html/parsoid -

+

!! end !! test @@ -17452,7 +17513,7 @@ djvu

LoremIpsum.djvu

!! html/parsoid -

+

!! end !! test @@ -17487,7 +17548,7 @@ Images with the "|" character in the comment
An external URL
!! html/parsoid -
An external URL
+
An external URL
!! end !! test @@ -18993,7 +19054,7 @@ Bad images - basic functionality [[File:Bad.jpg]] !! DISABLED/html/php !! html/parsoid -

+

!! end !! test @@ -19008,7 +19069,7 @@ Bar foo

!! html/parsoid

Foo bar - + Bar foo

!! end @@ -19307,7 +19368,7 @@ percent-encoding and + signs in internal links (Bug 26410) 3E 3E+

!! html/parsoid -

User:+% Page+title% %+ %20 %+ %+r % + 3E 3E+

+

User:+% Page+title% %+ %20 %+ %+r % + 3E 3E+

!! end !! test @@ -19320,8 +19381,8 @@ Special characters in embedded file links (bug 27679) Title with & ampersand

!! html/parsoid -

-

+

+

!! end !! test @@ -20061,7 +20122,7 @@ parsoid=wt2html,wt2wt
-
Test
+
Test
@@ -20077,9 +20138,9 @@ parsoid=wt2html,wt2wt [[Image:Foobar.jpg|right|300px]] !! html/parsoid

foo

-
caption
+
caption

bar

-
+
!! end #### ---------------------------------------------------------------- @@ -20642,6 +20703,22 @@ B bar !! end +!! test +References: 10. New shouldn't be added for unrelated edits. +!! options +parsoid={ + "modes": ["selser"], + "changes": [["#x", "remove"]], + "selser": "noauto" +} +!! wikitext +Unrelated text that's going to disappear. +A foo +!! wikitext/edited +Unrelated text. +A foo +!!end + !! test Entities in ref name !! options @@ -22107,9 +22184,8 @@ parsoid parsoid !! wikitext [[File:Foobar.jpg|thumb|caption]] -!! html !! html/parsoid -
caption
+
caption
!! end !! test @@ -22620,8 +22696,8 @@ Multi-line image caption generated by templates with/without trailing newlines [[File:Foobar.jpg|thumb|300x300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}]] [[File:Foobar.jpg|thumb|300x300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}\n\n]] !! html/parsoid -
foo\nA\nB\nC
-
foo\nA\nB\nC\n\n
+
foo\nA\nB\nC
+
foo\nA\nB\nC\n\n
!!end !! test @@ -22631,12 +22707,12 @@ parsoid=html2wt !! html

new para

-

new heading

+

new heading

!! wikitext foo new para -[[./Category:Foo]] +[[Category:Foo]] = new heading = !! end @@ -22954,6 +23030,19 @@ parsoid=html2wt [[Foo]] !! end +# See T93839 +!! test +New wikilinks should be serialized properly +!! options +parsoid=html2wt +!! html +Foo +Foo +!! wikitext +[[Foo]] +[[Foo]] +!! end + !! test New wiki links (href variations) !! options @@ -23161,7 +23250,7 @@ parsoid !! wikitext [[File:Foobar.jpg|thumb|alt=|bar]] !! html -
bar
+
bar
!! end #!! test @@ -23170,7 +23259,7 @@ parsoid #parsoid=html2wt #language=ar #!! html -#
+#
#!! wikitext #[[Imagen:Foobar.jpg|derecha|miniaturadeimagen]] #!! end @@ -23183,7 +23272,7 @@ Image: Block level image should have \n before and after 456 !! html/parsoid

123

-
+

456

!!end @@ -23195,7 +23284,7 @@ Image: New block level image should have \n before and after (existing content) 456 !! html/parsoid

123

-
+

456

!!end @@ -23208,9 +23297,9 @@ parsoid [[File:Foobar.jpg|thumb|upright=0.5|caption]] [[File:Foobar.jpg|thumb|500x500px|upright=0.5|caption]] !! html -
caption
-
caption
-
caption
+
caption
+
caption
+
caption
!!end !! test @@ -23220,7 +23309,7 @@ parsoid !! wikitext [[File:Foobar.jpg|500x500px|upright=0.5|caption]] !! html -

+

!!end !! test @@ -23229,7 +23318,7 @@ Image: from basic HTML (1) parsoid=html2wt !! html/parsoid - Alt + Alt !! wikitext [[File:Foobar.jpg|link=|alt=Alt|100x100px]] @@ -23240,7 +23329,7 @@ Image: from basic HTML (2) !! options parsoid=html2wt !! html/parsoid -Alt +Alt !! wikitext [[File:Foobar.jpg|link=|alt=Alt|100x100px]] !! end @@ -23250,7 +23339,7 @@ Image: from basic HTML (3) !! options parsoid=html2wt !! html/parsoid -Alt +Alt !! wikitext [[File:Foobar.jpg|link=Main|alt=Alt|100x100px]] !! end @@ -23260,7 +23349,7 @@ Image: from basic HTML (4) !! options parsoid=html2wt !! html/parsoid - + !! wikitext [[File:Foobar.jpg|link=]] !! end @@ -23584,7 +23673,7 @@ parsoid=html2wt 5a. Merge adjacent quote nodes if they've been edited !! options parsoid={ - "modes": ["wt2wt"], + "modes": ["wt2wt", "selser"], "changes": [ ["p", "contents", "remove", ":contains('b')"] ] @@ -23599,7 +23688,7 @@ parsoid={ 5b. Merge adjacent quote nodes if they've been edited !! options parsoid={ - "modes": ["wt2wt"], + "modes": ["wt2wt", "selser"], "changes": [ ["#x", "remove"] ] @@ -23836,11 +23925,111 @@ parsoid=html2wt,wt2wt !! end +!! test +HTML id attribute with Parsoid-like element ids should not be serialized to wikitext +!! options +parsoid=html2wt +!! html + + + +
foobar
+!! wikitext +{| +|foo +| id="serialize-this" |bar +|} +!! end + +!! test +Parsoid-like element ids should not be serialized to wikitext unless shadowed +!! options +parsoid=html2wt +!! html +
ok
+!! wikitext +
ok
+!! end + +!! test +WTS change modes +!! options +parsoid={ + "modes": ["wt2wt"], + "changes": [ + [ "#xyz", "before", "before stuff " ], + [ "#xyz", "after", " stuff after" ], + [ "#xyz", "html", "x y z" ] + ] +} +!! wikitext +hello +!! wikitext/edited +'''before''' stuff x '''y''' z stuff ''after'' +!! end + +!! test +Never serialize a-tag as html, regardless of what data-parsoid has to say +!! options +parsoid=html2wt +!! html +Foo +!! wikitext +[[Foo]] +!! end + # ----------------------------------------------------------------- # End of section for Parsoid-only html2wt tests for serialization # of new content # ----------------------------------------------------------------- +# ----------------------------------------------------------------- +# The following section of tests are primarily to spec behavior of +# the selective serializer. All these tests have manual selser +# changes. The automated selser changes for all tests handle the +# wide variation of changes, but these tests here capture specs +# deterministically. +# ---------------------------------------------------------------- + +## T90517 +!! test +1. Selser: New comments should not be lost +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + [ "#a", "after", "" ], + [ "#b", "before", "" ] + ] +} +!! wikitext +a + +b +!! wikitext/edited +a + +b +!! end + +## T89383 +!! test +2. Selser: Check for validity of DSR before using it +!! options +parsoid={ + "modes": ["selser"], + "changes": [ + [ "#a", "before", "" ] + ] +} +!! wikitext +a +!! wikitext/edited +{{DISPLAYTITLE:foo}} +a +!! end + + TODO: more images more tables